//
//  TravelItem.m
//  MiaoTu
//
//  Created by dllo on 16/09/03
//  Copyright (c) dllo. All rights reserved.
//

#import "TravelItem.h"
#import "Piclist.h"
#import "Assemblingplace.h"
#import "UserInfo.h"

@implementation TravelItem

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    NSMutableArray<Piclist *> *picArray = [NSMutableArray array];
    if ([key isEqualToString:@"PicList"]) {
        for (NSDictionary *dic in value) {
            Piclist *pic = [[Piclist alloc] init];
            [pic setValuesForKeysWithDictionary:dic];
            [picArray addObject:pic];
        }
        _PicList = picArray;
    }
    if ([key isEqualToString:@"AssemblingPlace"]) {
        _AssemblingPlace = [Assemblingplace modelWithDic:value];
    }
    if ([key isEqualToString:@"ReplyList"]) {
        NSMutableArray<UserInfo *> *replyList = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            UserInfo *user = [UserInfo modelWithDic:dic];
            [replyList addObject:user];
        }
        _ReplyList = replyList;
    }
    if ([key isEqualToString:@"JoinList"]) {
        NSMutableArray<UserInfo *> *joinList = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            UserInfo *user = [UserInfo modelWithDic:dic];
            [joinList addObject:user];
        }
        _JoinList = joinList;
    }
    if ([key isEqualToString:@"LikeList"]) {
        NSMutableArray<UserInfo *> *likeList = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            UserInfo *user = [UserInfo modelWithDic:dic];
            [likeList addObject:user];
        }
        _LikeList = likeList;
    }
}



@end
